package test.test1202;

import java.util.Random;

public class test07 {
    public static void main(String[] args) {
        int[] arr = {2, 588, 888, 1000, 10000};
        int[] brr = new int[5];
        int i = 0;
        Random r = new Random();
        while (i < arr.length) {
            int k = r.nextInt(arr.length);
            boolean n = show(brr, arr[k]);
            if (!n) {
                brr[i] = arr[k];
                i++;
                System.out.println(arr[k] + "元的奖金被抽出");
            }
        }
    }

    public static boolean show(int[] arr, int k) {
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] == k) {
                return true;
            }
        }
        return false;
    }
}
